// Anc Mucsic Edition
// Author: Suzuki_aka - Webiste: http://www.maphim.net
// Edit: nguagovt - Support & Update: http://blog.bay68.com

var $_ = function(a){if(!document.getElementById){return;} else{ return document.getElementById(a);}};
ANCMusic = new Bay68();

function Bay68(){
  this.up = function(a){
     b = $_(a).innerHTML;
     b = b.replace(/\[m\]/gi,"<span id='bay68' style='display:none'>"); b = b.replace(/\[\/m\]/gi,"</span>");
	 b = b.replace(/\<m\>/gi,"<span id='bay68' style='display:none'>"); b = b.replace(/\<\/m\>/gi,"</span>");
     $_(a).innerHTML = b; c = $_("bay68").innerHTML;
     if(c.indexOf() == -1) return c;				
  }
  this.Player = function(a,b,c){      
     if(a.indexOf != -1){var e = function(d){return a.split()[d];}, n = a.split.length, f = e(0,1);}
     dc = ANCMusic.ob(f);{ if(n) $_(b).innerHTML = dc; }  
  }
  this.ob = function(a){ 
  if(a.indexOf("youtube.com") != -1){v = a.match(/[\d\w]+/gi); c = v.length - 2; obj = show(v)[0];}	
  if(a.indexOf("zippyshare.com") != -1){v = a.match(/\d+/gi); obj = show(v)[1];}
  if(a.indexOf(".mp3",".wma",".m4a") != -1){obj = show(a)[2];}
  if(a.indexOf(".flv",".mp4",".wmv",".mpeg",".wmv",".avi") != -1){obj = show(a)[3];}  
  if(a.indexOf("mp3.zing.vn/bai-hat/") != -1){v = a.match(/[\d\w]+/gi); c = v.length - 2; obj = show(v[c])[4];}
  if(a.indexOf("mp3.zing.vn/video-clip/") != -1){v = a.match(/[\d\w]+/gi); c = v.length - 2; obj = show(v[c])[5];}
  if(a.indexOf("nhaccuatui.com/nghe?M=") != -1){v = a.match(/[\d\w]+/gi); c = v.length - 2; obj = show(v)[6];}	
  if(a.indexOf("nhaccuatui.com/mv4u/xem-clip/") != -1){v = a.match(/[\d\w]+/gi); c = v.length - 2; obj = show(v)[7];}	
  if(a.indexOf("nhaccuatui.com/nghe?L=") != -1){v = a.match(/[\d\w]+/gi); c = v.length - 2; obj = show(v)[8];}	
  return obj;}
}

var show = function(a){
sk = '&volume=100&autostart=true&repeat=always&backcolor=0xFFFFFF&amp;frontcolor=0x000000&amp;lightcolor=0xFF0000&amp;logo=http://nt0.upanh.com/b2.s32.d2/4d101aadc4a269fa7c7d9fe8c90b5ecb_52104330.logohunganh.png&amp',
pl = 'allowfullscreen="true" allownetworking="all" allowscriptaccess="always" type="application/x-shockwave-flash" src="http://dj247.net/dj/play/jwplayer07.swf"',
wh_mp3 = 'width="480" height="125"',
wh_video = 'width="512" height="311"',
_comb = '<li class="commentc"><a href="#fb-root" title="Press here to see comment song below"><span><span>Comments</span></span></a></li><li class="warning"><a target="_blank" onclick="alert("Please contact Yahoo nguagovt to error. Thanks ! "); return false;" href=""><span><span>Error</span></span></a></li>',
_ads = '<a href="http://www.hinhhot.org/" target="_blank"><img border="0" src="http://dj.tuoigi.com/quangcao/quangcao2.gif" width="512"/></a><br/>'
return data = [
//0 - Youtube.com	
'<embed '+wh_video+' flashvars="file=http://www.youtube.com/watch?v='+a[6]+'&plugins=hd-2'+sk+'" '+pl+' /><br/><center><img src="http://img.youtube.com/vi/'+a[6]+'/1.jpg"/><img src="http://img.youtube.com/vi/'+a[6]+'/2.jpg"/><img src="http://img.youtube.com/vi/'+a[6]+'/3.jpg"/><br/><ul class="buttons">'+_comb+'</ul></center>',
//1 - Zippyshare.com
''+_ads+'<embed '+wh_mp3+' flashvars="file=http://pl.bay68.com/get/zip/'+a[0]+'/'+a[1]+'.flv'+sk+'&plugins=spectrumvisualizer-1h&spectrumvisualizer.pluginmode=FLASH&controlbar.position=bottom" '+pl+' /><br/><center><ul class="buttons"><li class="download"><a href="http://www'+a[0]+'.zippyshare.com/v/'+a[1]+'/file.html" target="_blank" title="Click d? m? trang download"><span><span>Download</span></span></a></li>'+_comb+'</ul></center>',
//2 - .mp3 .wma .m4a
''+_ads+'<embed '+wh_mp3+' flashvars="file='+a+''+sk+'&plugins=spectrumvisualizer-1h&spectrumvisualizer.pluginmode=FLASH&controlbar.position=bottom" '+pl+' /><br/><center><ul class="buttons"><li class="download"><a href="'+a+'" target="_blank" title="Click d? download"><span><span>Download</span></span></a></li>'+_comb+'</ul></center>',
//3 - .flv .mp4 .wmv .mpeg .wmv .avi		
'<embed '+wh_video+' flashvars="file='+a+''+sk+'" '+pl+' /><br/><center><ul class="buttons"><li class="download"><a target="_blank" href="'+a+'" title="Click d? download"><span><span>Download</span></span></a></li>'+_comb+'</ul></center>',
//4 - mp3.zing.vn	
''+_ads+'<embed '+wh_mp3+' flashvars="file=http://pl.bay68.com/get/zing/bay/'+a+'.mp3'+sk+'&plugins=spectrumvisualizer-1h&spectrumvisualizer.pluginmode=FLASH&controlbar.position=bottom" '+pl+' /><br/><center><ul class="buttons"><li class="download"><a target="_blank" href="http://pl.bay68.com/get/zing/bay68/'+a+'.mp3" title="Click d? download"><span><span>Download</span></span></a></li>'+_comb+'</ul></center>',
//5 - mp3.zing.vn - video
'<embed '+wh_video+' flashvars="file=http://pl.bay68.com/get/zing/video/bay/'+a+'.mp4'+sk+'" '+pl+' /><br/><center><ul class="buttons"><li class="download"><a target="_blank" href="http://pl.bay68.com/get/zing/video/bay/'+a+'.mp4" title="Click d? download"><span><span>Download</span></span></a></li>'+_comb+'</ul></center>',
//6 - Nhaccuatui.com 
''+_ads+'<embed '+wh_mp3+' flashvars="file=http://pl.bay68.com/get/nct/'+a[6]+'.mp3'+sk+'&plugins=spectrumvisualizer-1h&spectrumvisualizer.pluginmode=FLASH&controlbar.position=bottom" '+pl+' /><br/><center><ul class="buttons"><li class="download"><a target="_blank" href="http://pl.bay68.com/get/nct/'+a[6]+'.mp3" title="Click d? download"><span><span>Download</span></span></a></li>'+_comb+'</ul></center>',
//7 - Nhaccuatui.com video
'<embed '+wh_video+' flashvars="file=http://pl.bay68.com/get/nct/video/'+a[7]+'/bay.mp4'+sk+'&plugins=spectrumvisualizer-1h&spectrumvisualizer.pluginmode=FLASH&controlbar.position=bottom" '+pl+' /><br/><center><ul class="buttons"><li class="download"><a target="_blank" href="http://pl.bay68.com/get/nct/video/'+a[7]+'/bay.mp4" title="Click d? download"><span><span>Download</span></span></a></li>'+_comb+'</ul></center>',
//8 - Nhaccuatui.com Playlist
''+_ads+'<embed src="http://www.nhaccuatui.com/l/'+a[6]+'" flashvars="target=blank&autostart=true&repeat=always" allowscriptaccess="always" quality="high" wmode="transparent" type="application/x-shockwave-flash" width="512" height="150"></embed>'
];}